package com.ruoyi.project.gzbook.dimensionrank.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.gzbook.dimensionrank.mapper.DgDimensionRankMapper;
import com.ruoyi.project.gzbook.dimensionrank.domain.DgDimensionRank;
import com.ruoyi.project.gzbook.dimensionrank.service.IDgDimensionRankService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 维度排行榜Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-06
 */
@Service
public class DgDimensionRankServiceImpl implements IDgDimensionRankService 
{
    @Autowired
    private DgDimensionRankMapper dgDimensionRankMapper;

    /**
     * 查询维度排行榜
     * 
     * @param id 维度排行榜主键
     * @return 维度排行榜
     */
    @Override
    public DgDimensionRank selectDgDimensionRankById(Long id)
    {
        return dgDimensionRankMapper.selectDgDimensionRankById(id);
    }

    /**
     * 查询维度排行榜列表
     * 
     * @param dgDimensionRank 维度排行榜
     * @return 维度排行榜
     */
    @Override
    public List<DgDimensionRank> selectDgDimensionRankList(DgDimensionRank dgDimensionRank)
    {
        return dgDimensionRankMapper.selectDgDimensionRankList(dgDimensionRank);
    }

    /**
     * 新增维度排行榜
     * 
     * @param dgDimensionRank 维度排行榜
     * @return 结果
     */
    @Override
    public int insertDgDimensionRank(DgDimensionRank dgDimensionRank)
    {
        dgDimensionRank.setCreateTime(DateUtils.getNowDate());
        return dgDimensionRankMapper.insertDgDimensionRank(dgDimensionRank);
    }

    /**
     * 修改维度排行榜
     * 
     * @param dgDimensionRank 维度排行榜
     * @return 结果
     */
    @Override
    public int updateDgDimensionRank(DgDimensionRank dgDimensionRank)
    {
        return dgDimensionRankMapper.updateDgDimensionRank(dgDimensionRank);
    }

    /**
     * 批量删除维度排行榜
     * 
     * @param ids 需要删除的维度排行榜主键
     * @return 结果
     */
    @Override
    public int deleteDgDimensionRankByIds(String ids)
    {
        return dgDimensionRankMapper.deleteDgDimensionRankByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除维度排行榜信息
     * 
     * @param id 维度排行榜主键
     * @return 结果
     */
    @Override
    public int deleteDgDimensionRankById(Long id)
    {
        return dgDimensionRankMapper.deleteDgDimensionRankById(id);
    }
}
